home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / Word.vu < prev    next >
Encoding:
Text File  |  1993-12-17  |  7.6 KB  |  209 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        Word.vu
  5. #
  6. #    Contains:    Quick look test script for Word version 4.0
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.5>     9/30/93    KTA        Initialize gFileName prior to gApptitle being updated by
  19. #                                    launchTwitch().
  20. #     <1.0.2>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  21. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  22. #
  23. # ****************************************************************************
  24. #
  25.  
  26.  
  27.  
  28. ########################################################################
  29. #                            External libraries 
  30. #=======================================================================
  31. Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","WordProcessor.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
  32.  
  33.  
  34. #########################################################################
  35. ########               Application Specific Tasks
  36. #########################################################################
  37.  
  38.  
  39. #########################################################################
  40. #                        InitAppGlobals()
  41. #========================================================================
  42. # Author:        ML
  43. # Description:    Sets up the app's globals.
  44. # Parameters:    None
  45. # Returns:        Nothing
  46. # Application:    Word
  47. # Examples:        InitAppGlobals()
  48. #========================================================================
  49. # History:
  50. #
  51. ########################################################################
  52. task InitAppGlobals()
  53. begin
  54.  
  55.     logstr('Setting up tool globals');
  56.                 
  57.     global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
  58.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  59.     global kTabPaletteNum := 1; 
  60.     global kAlignPaletteNum := 2;
  61.     global kSpacingPaletteNum := 3;
  62.     global kParSpacePaletteNum := 4;
  63.  
  64.     global gPaletteList :=    {
  65.                             {                        #### Start Palette #1 - Tabs
  66.                             {121, 48, 217, 57,0},    # Location of tab palette relative to the window
  67.                             kPalDocWind,            # Palette type
  68.                             {5,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  69.                             {19,8},                    # Offset between tools {h,v}
  70.                             0,                        # Not used at this time
  71.                             0                        # Not used at this time
  72.                             },                        #### End Palette #1
  73.                             {                        #### Start Palette #2 - Alignment
  74.                             {231, 48, 307, 57,0},        # Location of alignment palette relative to the window
  75.                             kPalDocWind,            # Palette type
  76.                             {4,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  77.                             {19,8},                    # Offset between tools {h,v}
  78.                             0,                        # Not used at this time
  79.                             0                        # Not used at this time
  80.                             },                        #### End Palette #2
  81.                             {                        #### Start Palette #3 - Line spacing
  82.                             {321, 48, 377, 57,0},        # Location of Line spacing palette relative to the window
  83.                             kPalDocWind,            # Palette type
  84.                             {3,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  85.                             {19,8},                    # Offset between tools {h,v}
  86.                             0,                        # Not used at this time
  87.                             0                        # Not used at this time
  88.                             },                        #### End Palette #3
  89.                             {                        #### Start Palette #4 - Paragraph spacing
  90.                             {391, 48, 427, 57,0},        # Location of Line Paragraph spacing palette relative to the window
  91.                             kPalDocWind,            # Palette type
  92.                             {2,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  93.                             {19,8},                    # Offset between tools {h,v}
  94.                             0,                        # Not used at this time
  95.                             0                        # Not used at this time
  96.                             }                        # End Palette #4
  97.     };
  98.  
  99.     ### Word                                                                            {Flag, Pattern, Line, Color}
  100.     ### Palette Elements:=        Tool#, Pal#,     ToolName,     ToolType,    DblClktoEnd        SetAttributes
  101.     global TabLeftTool :=         { 1,  1,        "Tab Left",        kClick, 0,                {0}                };
  102.     global TabCenterTool :=     { 2,  1,        "Tab Center",    kClick, 0,                {0}                };
  103.     global TabRightTool :=         { 3,  1,        "Tab Right",    kClick, 0,                {0}                };
  104.     global TabDecimalTool :=     { 4,  1,        "Tab Decimal",    kClick, 0,                {0}                };
  105.     global TabVerticalTool :=     { 5,  1,        "Tab Vertical",    kClick, 0,                {0}                };
  106.     global AlignLeftTool :=     { 1,  2,        "Align Left",    0,         0,                {0}                };
  107.     global AlignCenterTool :=     { 2,  2,        "Align Center",    0,         0,                {0}                };
  108.     global AlignRightTool :=     { 3,  2,        "Align Right",    0,         0,                {0}                };
  109.     global AlignLRTool :=         { 4,  2,        "Align LR",        0,         0,                {0}                };
  110.     global SingleSpaceTool :=     { 1,  3,        "Single Space",    0,         0,                {0}                };
  111.     global xSpaceTool :=         { 2,  3,        "1-1/2 Space",    0,         0,                {0}                };
  112.     global DoubleSpaceTool :=     { 3,  3,        "Double Space",    0,         0,                {0}                };
  113.     global NoParSpaceTool :=     { 1,  4,        "No Par Space",    0,         0,                {0}                };
  114.     global ParSpaceTool :=         { 2,  4,        "Par Space",    0,         0,                {0}                };
  115.  
  116.     # global Tool list
  117.  
  118.     global RulerRect:= {17,32,20,43};
  119.     global gWindowInset := {0,0,0,0};
  120.     
  121.     global TabToolList:={    TabLeftTool,
  122.                             TabCenterTool,
  123.                             TabRightTool,
  124.                             TabDecimalTool,
  125.                             TabVerticalTool
  126.     };
  127.  
  128.     global OtherToolList:={    AlignLeftTool,
  129.                             AlignCenterTool,
  130.                             AlignRightTool,
  131.                             AlignLRTool,
  132.                             SingleSpaceTool,
  133.                             xSpaceTool,
  134.                             DoubleSpaceTool,
  135.                             NoParSpaceTool,
  136.                             ParSpaceTool
  137.     };
  138.  
  139.     global RulerMenuPath := {'Show Ruler','Format'};
  140.     
  141.     global gDismissAboutBox:='Cancel';
  142.  
  143.     logstr('Setting up font globals');
  144.  
  145.         ### font characteristic lists
  146.     global gFontSizeList := {'9','10','12','14','18', '24'};
  147.     global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow'};
  148.  
  149.         ### Name of the Plain (style) menu item  ####
  150.     global gPlainStyle := "Plain Text";            # Plain-Style menu item
  151.  
  152.         ### How to get to the next line
  153.     global gNextLineMethod := 4;            
  154.         ### 1 - ReturnKey,  2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
  155.     
  156.         ### Does moving to the next line clear all font info
  157.     global gNextLineClearsFontSettings := 0;
  158.  
  159. end;    #InitAppGlobals
  160.  
  161. #########################################################################
  162. #                        Views()
  163. #========================================================================
  164. # Author:        ML
  165. # Description:    Change Views. 
  166. # Parameters:    None
  167. # Returns:        Nada
  168. # Application:    Word
  169. # Examples:        Views();
  170. #========================================================================
  171. # History:
  172. #
  173. ########################################################################
  174. task Views() 
  175. begin
  176.     LogStr( "    Changing Views    ");
  177.     SelectMenuItem("Print Preview", "File");
  178.     selectButton('Page View');
  179.     Println;
  180. end;
  181.  
  182. ################################################################################
  183. ####################             Main script                    ####################
  184. ################################################################################
  185. script Word (ScriptLevel:= -1)
  186. begin
  187.     InitGlobals(ScriptLevel);                    
  188.     InitDraw();
  189.     InitFonts();
  190.     global gAppTitle := 'Microsoft Word';
  191.     global gAppVersion := '4';
  192.     global gFileName := "@!@-{gBuildVers}-{gAppTitle}";    # This is used in SaveAs when saving files
  193.     SuiteStart('Word.vu');                                    # begin a new test suite
  194.     if LaunchTwitch("{gAppTitle}",gAliasDirectory)    # launch or twitch to your app
  195.     begin
  196.         InitAppGlobals();
  197.         (*
  198.         *)
  199.         DoSetUpApp(,,,,1,1);
  200.         DoText();
  201.         if (gAppTestLevel = 2)
  202.             DoWPTools();
  203.         Views();
  204.         DoWindow();
  205.         DoCloseApp(,'Cancel');
  206.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  207.     SuiteEnd();
  208. end;
  209.